from celery_tasks.sms.yuntongxun.sms import CCP
from . import constants
from celery_tasks.main import celery_app
# from django_redis import get_redis_connection
@celery_app.task(name="send_sms_code")
def send_sms_code(mobile, sms_code):
    """异步发送短信任务"""
    # print("OK")
    CCP().send_template_sms(mobile, [sms_code, constants.SMS_CODE_REDIS_EXPIRES // 60], constants.SEND_SMS_TEMPLATE_ID)
    # redis_conn = get_redis_connection("verify_codes")
    # redis_conn.setex("test",300,"sss")